<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%pageContext.setAttribute("ctx", request.getContextPath()); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>博客后台管理</title>
		<meta http-equiv="content-type" content="text/html;charset=UTF-8">
		<link href="${ctx}/admin/images/style.css" type="text/css"
			rel="stylesheet">
	</head>
	<script type="text/javascript">		
			function del() {
				var msg = "您真的确定要删除吗？\n\n请确认！";
				if (confirm(msg)==true){
						return true;
					}else{
						return false;
					}
				}
	</script>	
	<body>
		<div id="container">
			<div id="main">
			<h3>文章列表</h3>
<table id="tab">
<tr>
   <th>编号</th>
   <th>主题</th>
   <th>点击数</th>
   <th>分类</th>
   <th>添加时间</th>   
   <th>允许评论</th>
   <th>状态</th>
   <th>操作</th>
</tr>
<c:forEach items="${pagination.list}" var="e">
	<tr>
	       <td>${e.id}</td>
	       <td>${e.title}</td>
	       <td>${e.hits}</td>
	       <td>${e.category.name}</td>
	       <td><fmt:formatDate value="${e.createdTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
	       
	       <td>
	       <c:if test="${e.allowComment==1}">
	       		<img src="${ctx}/admin/images/yes.gif" border="0" alt="是">
	       	</c:if>
	       	<c:if test="${e.allowComment==0}">
	       		<img src="${ctx}/admin/images/no.gif" border="0" alt="否">
	       	</c:if>
	       	</td>
	       	<td>
	       <c:if test="${e.status==1}">
	       		<img src="${ctx}/admin/images/yes.gif" border="0" alt="开">
	       </c:if>
	       	<c:if test="${e.status==0}">
	       		<img src="${ctx}/admin/images/no.gif" border="0" alt="关">
	       	</c:if>
	       </td>	       
		   <td align="center">
		   <a href="${ctx}/admin/editEntry?id=${e.id}"><img src="${ctx}/admin/images/edit.gif" border="0" alt="编辑"></a>  
		   <a href="${ctx}/admin/deleteEntry?id=${e.id}" onclick="javascript:return del()"><img src="${ctx}/admin/images/delete.gif" border="0" alt="删除"></a>
		   </td>    
	</tr>
	</c:forEach>
</table>
					<!--分页的链接,开始-->
					<pg:pager id="pagination" url="${ctx}/admin/listEntrys" items="${pagination.maxElements}" maxPageItems="${pagination.pageSize}"  maxIndexPages="10">
						<pg:index>
							<pg:prev>
								<a href="${pageUrl}&p=${pageNumber}">&lt;上一页</a>
							</pg:prev>
							<pg:pages>
								<a href="${pageUrl}&p=${pageNumber}">${pageNumber}</a>				
							</pg:pages>
							<pg:next>
								<a href="${pageUrl}&p=${pageNumber}">下一页&gt;</a>
							</pg:next>
						</pg:index>
					</pg:pager>		
					<!--分页的链接,结束-->					
       </div>
		</div>
		<%@include file="/admin/footer.jsp"%>